/*
 * config.h
 *
 *  Created on: Jan 7, 2009
 *      Author: yospaly
 */

#ifndef CONFIG_H_
#define CONFIG_H_

#include <wx/config.h>
#include <wx/ffile.h>

class Config : public wxRegConfig {
public:
	static Config& get() {
        if (NULL==self) {
            self = new Config();
        }

        return *self;
	}
	
	/*
	 * return empty string if none
	 */
	wxString get_last_mirror() {
		this->Read(_T("last-mirror"), &_last_mirror, wxString());
		return _last_mirror;
	}
	bool set_last_mirror(const wxString& url) {
		return this->Write(_T("last-mirror"), url);
	}
	
	virtual ~Config();
	
protected:
	Config();
	
	wxString _last_mirror;
    wxString _logfile_path;
	wxArrayString _mirrors;
    wxFFile logfile;
	
    static Config* self;
};

#endif /* CONFIG_H_ */
